package org.estela.comp;

public class DeclareReference implements Statement {

	private String refName;
	
	private Expression refValue;
	
	private DataType dataType;

	public String getRefName() {
		return refName;
	}

	public void setRefName(String refName) {
		this.refName = refName;
	}

	public Expression getRefValue() {
		if (refValue == null) {
			return NullValue.instance;
		}
		return refValue;
	}

	public void setRefValue(Expression refValue) {
		this.refValue = refValue;
	}

	public String toString() {
		StringBuilder buff = new StringBuilder(getClass().getName());
		buff.append("@[name=").append(this.refName);
		buff.append(",dataType=").append(this.dataType);
		buff.append(",value=").append(this.refValue);
		buff.append(']');
		return buff.toString();
	}

	public DataType getDataType() {
		return dataType;
	}

	public void setDataType(DataType dataType) {
		this.dataType = dataType;
	}

	public void accept(StatementVisitor visitor) {
		visitor.visitDeclareReference(this);
	}
	
}
